package com.yc.ioc.test.bean2;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.concurrent.ThreadPoolExecutor;

public class App1_old {
    public static void main(String[] args) {
//        ApplicationContext context = new AnnotationConfigApplicationContext(Student.class);
//
//        Student student = context.getBean(Student.class);
//        System.out.println(student);
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);
        ThreadPoolExecutor tpe = context.getBean("tpe", ThreadPoolExecutor.class);
        tpe.execute(() -> {
            System.out.println("hello");
        });
        tpe.shutdown();
        Student student = context.getBean("student", Student.class);
        System.out.println(student);
        Address address = context.getBean("address", Address.class);
        System.out.println(address);



    }
}
